<?php
declare (strict_types = 1);

namespace app\controller;

use think\facade\Cache;
use think\facade\Db;
use think\facade\View;
use think\Request;

class Douyin extends Common
{

    public function __construct()
    {
        parent::__construct();
    }
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function df()
    {

        $cid = input("get.cid",71);

        if($cid){
            $where["cate_id"] = $cid;
        }
        $order = input("get.order");
        if($order == 1){
            $o = "id ASC";
        }else{
            $o = "id DESC";
        }

        $where["status"] =1;
        $where["model_id"] =1;

        if(!isset($where)){
            $where = 1;
        }

        $list = \app\common\model\Content::with("user")
            ->where($where)
            ->order($o)
            ->paginate([
                'query'=> $this->params,
            ]);

        View::assign("list",$list);
        return  view();
    }


}
